<?php
/**
 * User: fwj
 * Date: 2018/6/14
 * Time: 9:41
 */

namespace app\index\model;


use think\Model;

class Student extends Model
{
    //关联班级
    public function grade()
    {
        return $this->belongsTo('Grade');
    }
    //sex返回值设置
    public function getSexAttr($value)
    {
        $sex = [
            0 => '女',
            1 => '男'
        ];
        return $sex[$value];
    }
}